import { createRouter, createWebHashHistory } from 'vue-router'
import nprogress from 'nprogress';
import 'nprogress/nprogress.css';
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('@/views/home.vue')
    },
    {
      path: '/news',
      name: 'news',
      component: () => import('@/views/news.vue')
    },
    {
      path: '/product',
      name: 'product',
      component: () => import('@/views/product.vue')
    },
  ]
})

router.beforeEach((to, from, next) => {
  nprogress.start()
  next()
})
router.afterEach(guard => {
  nprogress.done()
})
export default router
